﻿using Microsoft.CodeAnalysis;
using System.Collections.Generic;
using System.Linq;
using System.Threading;

namespace SharpAnalyzer.Analyzers
{
    internal sealed class MethodOverloadsAnalyzer
    {
        public static int Calculate(SemanticModel model, SyntaxNode node)
        {
            ISymbol declaredSymbol = model.GetDeclaredSymbol(node);
            if (declaredSymbol != null && (declaredSymbol.Kind == SymbolKind.Method))
                return declaredSymbol.ContainingType.GetMembers(declaredSymbol.Name).Count();
            return 0;
        }
    }
}
